GH-134584: Remove redundant refcount from _STORE_ATTR_SLOT#142729
GH-134584: Remove redundant refcount from _STORE_ATTR_SLOT#142729savannahostrowski merged 6 commits intopython:mainfrom
_STORE_ATTR_SLOT#142729Conversation
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Nice job, you're pretty close already. Just one thing missing.
|
Just to demonstrate the power of this class of optimization. If you were able to remove all decrefs from Before (current main): After: So it's roughly half of the original size of code. The problem right now is that we can't (yet) remove the _STORE_ATTR_SLOT's Py_XDECREF. However, in the very near future once we specialize on more forms of object creation, we can optimize thru that. Then for something like We would be able to reason that the current object is a fresh one, thus there's no decref needed as there's no attribute currently. So we'd be able to get the full optimization. (The above example is for non-slots, but it's the same idea). |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Thanks, LGTM. Let's wait a day before merging.
Uh oh!
There was an error while loading. Please reload this page.